#ifndef GAMESTATE_H
#define GAMESTATE_H

#include <functional>
#include "EventHandler.h"
#include <SDL.h>

namespace Engine
{
	class GameState: public EventHandler
	{
		protected:
			bool m_active;

		public:
			friend class EventPoller;
			GameState();

			virtual ~GameState() = 0 {}
			virtual const char* GetName() const = 0;
			virtual unsigned int GetHash() const = 0;
			virtual void Activate() {m_active = true;}
			bool IsActive() const {return m_active;}
			virtual void Update() = 0;
			virtual void Draw() = 0;
			virtual void Deactivate() {m_active = false;}

			virtual void OnKeyboardEvent(const SDL_KeyboardEvent& k){}
			//mouse events
			virtual void OnMouseMotionEvent(const SDL_MouseMotionEvent& m){}
			virtual void OnMouseButtonEvent(const SDL_MouseButtonEvent& m){}
			//joy pad events
			virtual void OnJoyHatEvent(const SDL_JoyHatEvent& j){}//d pad
			virtual void OnJoyAxisEvent(const SDL_JoyAxisEvent& j){}//analog stick
			virtual void OnJoyButtonEvent(const SDL_JoyButtonEvent& j){}//buttons
			virtual void OnQuit(){}
	};
}

#endif
